class Student:
    def __init__(self, id, name, age, gender, hight, weight, score, address, phone):
        self.id = id
        self.name = name
        self.age = age
        self.gender = gender
        self.hight = hight
        self.weight = weight
        self.score = score
        self.address = address
        self.phone = phone

    def study(self, time):
        print('%s学习了%s小时' % (self.name, time))

    def playGame(self, game):
        print('%s玩%s' % (self.name, game))

    def program(self, lines):
        print('%s写了%s行代码' % (self.name, lines))

    def add(self, *args):
        print('总和是' + str(sum(args)))


class Car:
    def __init__(self, xinghao, chelunshu, yanse, zhongliang, youxiangdaxiao):
        self.xinghao = xinghao
        self.chelunshu = chelunshu
        self.yanse = yanse
        self.zhongliang = zhongliang
        self.youxiangdaxiao = youxiangdaxiao

    def run(self, gongneng):
        print('%s在%s' % (self.xinghao, gongneng))


class Notebook:
    def __init__(self, model, battery_life, color, weight, cpu, ram, storage):
        self.model = model
        self.battery_life = battery_life
        self.color = color
        self.weight = weight
        self.cpu = cpu
        self.ram = ram
        self.storage = storage

    def play_game(self, game_name):
        print(f'{self.model}正在玩{game_name}')

    def work(self):
        print(f'{self.model}正在工作')


class Monkey:
    def __init__(self, species, gender, body_color, weight):
        self.species = species
        self.gender = gender
        self.body_color = body_color
        self.weight = weight
        self.knowledge = []

    def make_fire(self, material):
        print(f"{self.species} 正在尝试用 {material} 造火")

    def learn(self, *things):
        self.knowledge.extend(things)
        things_str = "、".join(things)
        print(f"{self.species} 学会了：{things_str}！")

    def show_knowledge(self):
        if self.knowledge:
            print(f"当前掌握的知识有：{'.'.join(self.knowledge)}")
        else:
            print(f"还未掌握任何知识")


# 创建法拉利对象
falali = Car('法拉利', 4, '红色', 2000, '中等')
# 创建宝马对象
bmw = Car('宝马', 4, '蓝色', 2000, '中等')
# 创建铃木对象
lingyu = Car('铃木', 4, '白色', 2000, '大')
# 创建五菱对象
wuling = Car('五菱', 4, '黑色', 2000, '大')
# 创建拖拉机对象
duliao = Car('拖拉机', 3, '黑色', 2000, '超大')
falali.run('越野')
class Human:
    def __init__(self, name, gender, age, balance, phone_brand, battery_capacity, screen_size, standby_time, points=0):
        self.name = name
        self.gender = gender
        self.age = age
        self.balance = balance
        self.phone_brand = phone_brand
        self.battery_capacity = battery_capacity
        self.screen_size = screen_size
        self.standby_time = standby_time
        self.points = points

    def send_sms(self, message):
        print(f"{self.name} 发出了一条短信:{message}")

    def make_call(self, phone_number, duration):
        if not phone_number:
            print("错误：电话号码不能为空！")
            return

        if self.balance < 1:
            print("错误：余额不足1元，无法拨打电话！")
            return

        # 计费和积分规则
        total_cost = 0
        total_points = 0

        for minute in range(1, duration + 1):
            if minute <= 10:
                total_cost += 1
                total_points += 15
            elif minute <= 20:
                total_cost += 0.8
                total_points += 39
            else:
                total_cost += 0.65
                total_points += 48

        if self.balance < total_cost:
            print(f"余额不足以拨打 {duration} 分钟电话，最多可拨打 {(self.balance // 1)} 分钟")
            return

        self.balance -= total_cost
        self.points += total_points

        print(f"成功拨打 {phone_number}，通话时长：{duration} 分钟")
        print(f"扣费：{total_cost:.2f} 元，积分增加：{total_points}，当前余额：{self.balance:.2f} 元，积分：{self.points}")

# 示例
human = Human(
    name="lxl",
    gender="女",
    age=21,
    balance=30.0,
    phone_brand="小米",
    battery_capacity=5000,
    screen_size=6.5,
    standby_time=100,
    points=0
)

# 发短信示例
human.send_sms("疯狂星期四v我50")

# 打电话示例
human.make_call("13812345678", 12)
